package com.jilefojing.beans.pojos.enhanced;

import java.util.Date;

import com.jilefojing.beans.enums.PlatformEnumForPublish;
import com.jilefojing.beans.enums.StatusEnumForPublish;
import com.jilefojing.beans.pojos.Banner;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月19日 13时29分29秒
 */
public class EnhancedBanner extends BaseEnhanced {
	public EnhancedBanner(Banner banner) {
		// TODO 自动生成 细微误差自己调整
		if (banner.getId() != null) {
			this.id = banner.getId();
		}
		this.coverUrl = banner.getCoverUrl();
		if (banner.getStatus() != null) {
			this.status = StatusEnumForPublish.getStatusEnumByCode(banner.getStatus());
		}
		this.createTime = banner.getCreateTime();
		this.startTime = banner.getStartTime();
		this.endTime = banner.getEndTime();
		if (banner.getCreateUser() != null) {
			EnhancedUser enhancedCreateUser = new EnhancedUser();
			enhancedCreateUser.setId(banner.getCreateUser());
			this.enhancedCreateUser = enhancedCreateUser;
		}
		this.updateTime = banner.getUpdateTime();
		this.title = banner.getTitle();
		this.url = banner.getUrl();
		if (banner.getPlatform() != null) {
			this.platform = PlatformEnumForPublish.getPlatformEnumByCode(banner.getPlatform());
		}
		if (banner.getSort() != null) {
			this.sort = banner.getSort();
		}
	}

	public EnhancedBanner() {
	}

	private long id;
	private String coverUrl;
	private StatusEnumForPublish status;
	private Date createTime;
	private Date startTime;
	private Date endTime;
	private EnhancedUser enhancedCreateUser;
	private Date updateTime;
	private String title;
	private String url;
	private PlatformEnumForPublish platform;
	private double sort;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getCoverUrl() {
		return coverUrl;
	}

	public void setCoverUrl(String coverUrl) {
		this.coverUrl = coverUrl;
	}

	public StatusEnumForPublish getStatus() {
		return status;
	}

	public void setStatus(StatusEnumForPublish status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public EnhancedUser getEnhancedCreateUser() {
		return enhancedCreateUser;
	}

	public void setEnhancedCreateUser(EnhancedUser enhancedCreateUser) {
		this.enhancedCreateUser = enhancedCreateUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public PlatformEnumForPublish getPlatform() {
		return platform;
	}

	public void setPlatform(PlatformEnumForPublish platform) {
		this.platform = platform;
	}

	public double getSort() {
		return sort;
	}

	public void setSort(double sort) {
		this.sort = sort;
	}

}